<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.util.Vector,java.util.ArrayList,com.ejoysoft.wlanyz.business.Comunity,com.ejoysoft.wlanyz.business.Ac,com.ejoysoft.common.Constants,com.ejoysoft.wlanyz.system.SysUserUnit,com.ejoysoft.common.exception.NoRightException" %>
<%@ include file="../include/jsp/head.jsp"%>

<%try{
	if (!globa.userSession.hasRight("20015"))
		throw new NoRightException("用户不具备操作该功能模块的权限，请与系统管理员联系！");
		String s=request.getParameter("fileupload");
      String l=request.getParameter("textfield");
		if(s!=null){
		//String url=s.replace("\\","/");
		String url=s.replaceAll("\\\\","\\\\\\\\");
		  //System.out.println("gggggggggggggggggggg"+url);
		Comunity t = new Comunity();
		t.method(url);
		}
%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";

	//初始化
	Comunity user0 = null;
	Comunity obj = new Comunity(globa);
	//查询条件
	String strSiteName = ParamUtil.getString(request, "strSiteName", "");
	String tWhere = " WHERE 1=1";
	if (!strSiteName.equals("")) {
		tWhere += " and strSiteName LIKE '%" + strSiteName + "%'";
	}
	tWhere += " ORDER BY dtCreatDate";
	//记录总数
	int intAllCount = obj.getCount(tWhere);
	//当前页
	int intCurPage = globa.getIntCurPage();
	//每页记录数
	int intPageSize = globa.getIntPageSize();
	//共有页数
	int intPageCount = (intAllCount - 1) / intPageSize + 1;
	// 循环显示一页内的记录 开始序号
	int intStartNum = (intCurPage - 1) * intPageSize + 1;
	//结束序号
	int intEndNum = intCurPage * intPageSize;
	//获取到当前页面的记录集
	Vector<Comunity> vctObj = obj.list(tWhere, intStartNum, intPageSize);
	//获取当前页的记录条数
	int intVct = (vctObj != null && vctObj.size() > 0 ? vctObj.size()
			: 0);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=application.getAttribute("APP_TITLE")%></title> 
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="../include/date/popc.js"></script>
<script src="../include/js/list.js"></script>
<script language="javascript">
//增加信息
function add() {
   frm.action="comunity_add.jsp";
   frm.submit();
}

 function showAc(){
   document.getElementById('<%=Constants.PAGE_SIZE_INDEX%>').value= "1";
  frm.submit();
 }

//批量删除信息
function del(){
	if (iCheckedNumber(document.all.strCommId) == 0) {
		alert("请先选择要删除的记录！");
		return;
	}
    if(!confirm('您是否确认要删除所选中的所有记录？'))
        return;
     frm.action="comunity_act.jsp?<%=Constants.ACTION_TYPE%>=<%=Constants.DELETE_STR%>";    
     frm.submit();
} 

//导出数据
function export_sbm(page){ 
  
  frm.action="comunity_export.jsp";
  document.getElementById("strCurPage").value = "<%=intCurPage%>";//当前页
  document.getElementById("exportContent").value = page;
  frm.submit();
  
 }
 
  function import_sbm()
 {
 window.open ('comunity_excel.jsp','newwindow','height=100,width=425,top=320,left=450,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no');
 }
</script>
</head>



<body>
<form name=frm method=post action="comunity_list.jsp"> 
<td><input id="exportFlag" name="exportFlag" type="hidden" value="exportResult"/>
		 <input id="strCurPage" name="strCurPage" type="hidden" value=""/>
			<input id="exportContent" name="exportContent" type="hidden" value=""/></td>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><img src="../images/ri_list.jpg" width="14" height="14" align="absbottom" />&nbsp;您现在所在的位置：<font color="#0e7cc9">资源管理</font> &gt; 小区信息管理</td>
  </tr>
</table>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  
  <tr>
    <td height="45" valign="middle" bgcolor="e1eef7">
      <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="89%">小区名：
          <input type="text" name="strSiteName" value="<%=strSiteName.trim() %>"/>
         <img src="../images/search.jpg" width="58" height="28" align="absmiddle" onclick="showAc()" style="cursor:hand"/></td>
          <td width="11%" align="right"><img src="../images/add.jpg" width="64" height="27" onClick="add()" style="cursor:hand"/></td>
        </tr>
      </table></td>
  </tr>
</table>

<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>
    <td width="5%" class="listtit"  style="border-left:1px solid #32a4ea;"><input type="checkbox" name="checkbox62" value="checkbox" onclick="selAll(document.all.strCommId)" style="height:12px;" /> 全选</td>
    
    
    <td width="9%" class="listtit">小区名</td>
    <td width="7%" class="listtit">LAC</td>
    <td width="7%" class="listtit">CI</td>
    
    <td width="7%" class="listtit">小区站型</td>
    <td width="11%" class="listtit">所在地址</td>    
    <td width="9%" class="listtit">基本操作</td>
  </tr>
    <%
    	for (int i = 0; i < vctObj.size(); i++) {
    		
    		String commId = "";
    		String siteName = "";
    		String lac = "";
    		String ci = "";
    		String jwDu = "";
    		String weiDu = "";
    		String siteType = "";
    		String addr = "";
    		Comunity obj3 = vctObj.get(i);
    		
    		if (obj3.getStrCommId() != null)
    			commId = obj3.getStrCommId();
    		if (obj3.getStrSiteName() != null)
    			siteName = obj3.getStrSiteName();
    		if (obj3.getStrLongitude() != null||obj3.getStrLatitude() != null)
    			jwDu = obj3.getStrLongitude()+","+obj3.getStrLatitude();
    		if (obj3.getStrSiteType() != null)
    			siteType = obj3.getStrSiteType();
    		if (obj3.getStrSiteAddr() != null)
    			addr = obj3.getStrSiteAddr();
    		if (obj3.getStrLac() != null)
    			lac = obj3.getStrLac();
    		if (obj3.getStrCI() != null)
    			ci = obj3.getStrCI();
    %>

  <tr>
  	<td class="listd1" style="border-left:1px solid #dddddd;"><input type="checkbox"  name=strCommId value="<%=obj3.getStrCommId()%>" style="height:12px;" /></td>
    <td class="listd1" style="border-left:1px solid #dddddd;"> <a href='comunity_show.jsp?strCommId=<%=obj3.getStrCommId()%>'><%=siteName%></a>&nbsp;</td>
    <td class="listd1"><%=lac%>&nbsp;</td>
    <td class="listd1"><%=ci%>&nbsp;</td>
    
    <td class="listd1"><%=siteType%>&nbsp;</td>
    <td class="listd1"><%=addr%>&nbsp;</td>

    <td class="listdrd" style="border-right:1px solid #dddddd;"> <img src="../images/mid.jpg" width="12" height="12" align="absmiddle" /> <a href="comunity_update.jsp?strCommId=<%=obj3.getStrCommId()%>&strSiteName=<%=obj3.getStrSiteName()%>" >修改</a> <img src="../images/del.jpg" width="11" height="11" align="absmiddle" />
						<a href="#"
							onclick="if(confirm('确认删除该记录？')){location.href='comunity_act.jsp?<%=Constants.ACTION_TYPE%>=<%=Constants.DELETE_STR%>&strCommId=<%=obj3.getStrCommId()%>';}">删除</a>
					</td>  </tr>
             <%
             	}
             	
             %>
</table>

<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="61%" height="50" valign="bottom">
    <img src="../images/pldel.jpg" width="83" height="27" align="absmiddle" onclick="del();"/>
    <img src="../images/dc.jpg" width="92" height="27" align="absmiddle" onclick="export_sbm('currentPage')" style="cursor:hand"/> 
    <img src="../images/dcall.jpg" width="82" height="27" align="absmiddle" onclick="export_sbm('allPage')" style="cursor:hand"/>
     <input name="B1" type="button" value="导入" onclick="import_sbm()"   />
    <br />&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td width="39%" align="right" valign="bottom">            <!-- 翻页开始 -->  
     	<%@ include file="../include/jsp/cpage.jsp"%>
       	<!-- 翻页结束 --> </td>
  </tr>
</table>




 </form>
</body>
</html>
<%     	}catch (Exception e) {
            e.printStackTrace();        
        } %>
<%@ include file="../include/jsp/footer.jsp"%>